<?php

namespace app\common\model\search;

trait ShoppingSpuSearch
{
    public function searchNameAttr($query, $value, $data)
    {
        return $query->whereLike('name', $value);
    }

    public function searchCategoryIdAttr($query, $value, $data)
    {
        return $query->where('category_id', $value);
    }

    public function searchClassIdAttr($query, $value, $data)
    {
        return $query->where('class_id', $value);
    }

    public function searchBrandIdAttr($query, $value, $data)
    {
        return $query->where('brand_id', $value);
    }
}